<?

class bf_view {

	private $opts;

	public function __construct($options = array()) {

		if (!is_array($options))
			$options = array('file' => $options);

		$this->opts = array_merge(array(
			'location' => dirname(__FILE__) . '/../../views/',
			'file' => 'noname',
		), $options);

		if (!preg_match('/\/$/', $this->opts['location']))
			$this->opts['location'] .= '/';
	}

	public function __destruct() {
	}

	public function render() {
		$filename = $this->opts['location'] . $this->opts['file'];
		if (!preg_match('/\.php$/', $filename) && !is_file($filename))
			$filename .= '.php';
		require($filename);
	}
}

?>